package cn.csxw.openchina.ui.fragment.myFragment;

import android.os.Bundle;
import android.support.annotation.Nullable;

import java.util.ArrayList;

import javax.inject.Inject;

import cn.csxw.openchina.base.BaseRecAdapter;
import cn.csxw.openchina.base.BaseRefreshFragment;
import cn.csxw.openchina.dagger2.component.DaggerMyFollowFansFragmentComponent;
import cn.csxw.openchina.dagger2.module.MyFollowFansFragmentModues;
import cn.csxw.openchina.dagger2.presenter.MyFollowFansFragmentPresenter;
import cn.csxw.openchina.entity.bean.FriendBean;
import cn.csxw.openchina.ui.adapter.MyFollowAdapter;
import cn.csxw.openchina.utils.Global;

/**
 * 关注Fragment中的粉丝
 */
public class MyFollowFansFragment extends BaseRefreshFragment {
    public MyFollowAdapter mAdapter;
    @Inject
    public MyFollowFansFragmentPresenter mMyFollowFragmentPresenter;

    @Override
    protected BaseRecAdapter getAdapter() {
        ArrayList<FriendBean> friendBeanList = new ArrayList<>();
        if (mAdapter == null) {
            mAdapter = new MyFollowAdapter(friendBeanList);
        }
        return mAdapter;
    }

    @Override
    public void doRefresh() {

    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        DaggerMyFollowFansFragmentComponent.builder().myFollowFansFragmentModues(
                new MyFollowFansFragmentModues(this)).build().inject(this);
        mMyFollowFragmentPresenter.callNetWork("993896", 0, 20, 1);
        Global.onNetworkStateListener(mMyFollowFragmentPresenter, this);
    }
}
